package com.settlement.system.service;

import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblOrderCloseAccount;
import org.springframework.cache.annotation.Cacheable;

import java.util.Date;
import java.util.List;

/**
 * 订单稽核-关账表 服务类
 *
 * @author Ximi
 * @since 2020-09-17
 */

public interface ITblOrderCloseAccountService extends IBaseService {

    /**
     * 更新真是的关帐日期
     *
     * @param account
     * @return
     * @throws ServiceException
     */
    public Integer updateRealCloseAccountDate(TblOrderCloseAccount account) throws ServiceException;

    /**
     * 通过 id 获取关账数据
     *
     * @param id
     * @return
     * @throws ServiceException
     */
    public TblOrderCloseAccount getById(String id) throws ServiceException;

    /**
     * 获取多个关账数据,通过多个id
     *
     * @param ids
     * @return
     * @throws ServiceException
     */
    public TblOrderCloseAccount getByIds(List<String> ids) throws ServiceException;

    /**
     * 通过店铺编码 和 账号获取锁帐数据
     *
     * @param threeChannelNo 三级来源编码
     * @param shopAccount
     * @return
     * @throws ServiceException
     */
    @Cacheable("closeAccountByThreeChannelNoAndShopAccount")
    public TblOrderCloseAccount getByThreeChannelNoAndShopAccount(String threeChannelNo, String shopAccount) throws ServiceException;

    /**
     * 批量关账
     *
     * @param ids
     * @param realCloseAccountDate
     * @return
     * @throws ServiceException
     */
    public void closeAccount(List<String> ids, Date realCloseAccountDate) throws ServiceException;

    /**
     * 删除关账
     *
     * @param account
     * @throws ServiceException
     */
    public void deleteCloseAccount(TblOrderCloseAccount account) throws ServiceException;


}

